package com.fs.constant;

/**
 * Created by fengshuai on 17/5/18.
 */
public enum SegmentEnum {
    MORNING(1,"凌晨"),
    MIDDAY(2,"上午"),
    NOON(3,"中午");

    private int type;
    private String comment;
    private SegmentEnum(int type, String comment) {
        this.type = type;
        this.comment = comment;
    }

    public int getType() {
        return type;
    }

    public String getComment() {
        return comment;
    }

    public static SegmentEnum getByType(int type) {
        for (SegmentEnum segmentEnum : values()) {
            if (segmentEnum.getType() == type) {
                return segmentEnum;
            }
        }
        return null;
    }
}
